package com.scau.database.controller.admin;

import com.scau.data.entity.FactoryDO;
import com.scau.database.service.admin.FactoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: kongyuer
 * @Date: 2020/5/9 17:55
 */
@RestController
@RequestMapping("/api/admin")
public class FactoryController {

    @Autowired
    public FactoryService factoryService;

    @GetMapping("/getFactory")
    public List<FactoryDO> getFactory () {
        return factoryService.echo();
    }

    @PostMapping("/addFactory")
    public Integer addFactory (@RequestBody FactoryDO DO) {
        return factoryService.addFactory(DO);
    }
}
